package cn.com.zsc.schedule;

import java.util.Date;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import cn.com.zsc.hr.AttendanceManager;

public class ScheduleJob implements Job {

	static Logger logger = Logger.getLogger(ScheduleJob.class.getName());

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
//		logger.info("<<<<<<<<<<<<<<任务执行<<<<<<<<<<<<<<<<");
		Date dt = context.getFireTime();
		Date dtNext = context.getNextFireTime();
		String jobName = context.getJobDetail().getFullName();
//		logger.info("任务名称:.." + jobName);
//		logger.info("任务触发时间:" + dt.toString());
		if (dtNext != null)
		    logger.info("任务下一次执行时间:" + dtNext.toString());

		String group = context.getJobDetail().getGroup();

		if (group.equals("AD")) {
//			int copyCount = new AttendanceManager().copyAttInfoToSys();
//			logger.info("copyCount"+copyCount);
			context.setResult("aaaaa");
			// System.out.println("<<<<<<<<<<<<<任务结束<<<<<<<<<<<<<<<<<");
			// System.out.println("<<<<<<<<<<<<<任务结束<<<<<<<<<<<<<<<<<");
		}
//		logger.info("<<<<<<<<<<<<<任务结束<<<<<<<<<<<<<<<<<");
	}
}
